﻿#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    initWidget();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::initWidget()
{
    ui->le_border->setText("5");
    ui->le_step->setText("0.5");
    connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), ui->widget_battery, SLOT(setValue(int)));
    ui->horizontalSlider->setValue(0);
}

void Widget::on_pb_set_clicked()
{
    ui->widget_battery->setBorderWidth(ui->le_border->text().toInt());
    ui->widget_battery->setStep(ui->le_step->text().toDouble());
}
